<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>

    <link rel="stylesheet" href="{CSS}admin/reset.css">
    <link rel="stylesheet" href="{CSS}admin/bootstrap-admin.css">
    <link rel="stylesheet" href="{CSS}admin/backstage.css">
    <link rel="stylesheet" href="{CSS}public/page.css">
    <script src="{JS}public/jquery-1.8.3.min.js"></script>
    <script>pageurl="?m=admin&c=Catec&a=cate_list";</script>
    <script src="{JS}public/page.js"></script>
</head>
<body>
<div class="details">
    <div class="details_operation clearfix">
        <div class="bui_select">
            <input type="button" value="添加分类" class="btn btn-primary"  onclick="addCate()">
        </div>

    </div>
    {include file="{APP_PPDP}/admin/search.html"}
    <!--表格-->
    <div id="show">
    <table class="table table-hover" cellspacing="0" cellpadding="0">
        <thead>
        <tr>
            <th align="center"  width="20%">分类</th>
            <th align="center"  width="20%">所属商户</th>
            <th align="center" width="30%">权重</th>
            <th align="center" >操作</th>
        </tr>
        </thead>
        <tbody>
        {if $data neq ""}
      {foreach $data as $key=>$val}
        <tr>

            <td align="center">{$val.cName}</td>
            <td align="center">{$val.adminName}</td>
            <td align="center">{$val.weight}</td>
            <td align="center"><a class="btn btn-link" onclick="editCate({$val.id})">修改</a><a class="btn btn-link"  onclick="delCate({$val.id})">删除</a></td>
        </tr>
        {/foreach}

        </tbody>
    </table>
        {$page}
        <p align="center">共{$count}条数据</p>
        {/if}
    </div>
</div>
<script type="text/javascript">
    function editCate(id){
        window.location="?m=admin&c=Catec&a=cate_edit&cId="+id;
    }
    function delCate(id){
        if(window.confirm("您确定要删除吗？删除之后不能恢复哦！！！")){
            window.location="?m=admin&c=Catec&a=cate_delete&cId="+id;
        }
    }
    function addCate(){
        window.location="?m=admin&c=Catec&a=index";
    }
</script>
</body>
</html>